package org.dromara.basic.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.dromara.basic.domain.TeachClass;
import org.dromara.basic.domain.vo.TeachClassVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;

import java.util.List;

/**
 * 教学班级Mapper接口
 *
 * @author chl
 * @date 2024-09-10
 */
@Mapper
public interface TeachClassMapper extends BaseMapperPlus<TeachClass, TeachClassVo> {

    @Select("SELECT DISTINCT class_id, class_name, grade, t.dept_id FROM phy_basic_teach_class t ,sys_dept d WHERE t.dept_id = d.dept_id AND d.parent_id = #{majorId}")
    List<TeachClassVo> queryListByMajor(@Param("majorId") Integer majorId);

    List<TeachClassVo> selectTeachClassList(@Param(Constants.WRAPPER) Wrapper<TeachClass> queryWrapper);

}
